home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / misc / g5library / doku / gatewaylibraryeng.readme < prev    next >
Text File  |  1999-04-19  |  13KB  |  590 lines

  1. Sorry, a full english version of the guide not exists.
  2. My english isn't good enough to create a guide or doc.
  3.  
  4. But I will do this shot readme to give a litte help and hope
  5. you understand it:
  6.  
  7. At first, a lot of backgroundinformation's are in the german document.
  8. A typical copyright with full permission to use. The archive must been
  9. original if you give the archive to another person. Commercial use is
  10. forbidden.
  11. And, a very importand information: Gateway-5 is a BBS-Programm, based
  12. on Gateway-IV and so on. The first program only called Gateway. For over
  13. 10 Years! Now, the owner of the Amiga call Gateway, too. But, my program
  14. and "Gateway 2000" have only the same name, not more!
  15.  
  16.  
  17. The functions in this library are created in the last 10 years. For
  18. different programs and differnt usage. So the names of the variables
  19. are very differnt.
  20. All functions are everytime backward compatible. And so the one or
  21. another is not perfect or locks very fine. But, all functions work
  22. correct and the functions that use they often long time not changed.
  23. The program was written on Aztec-C in the past and as I changed the old
  24. compiler to vbcc there are not all functions available. Functions that
  25. be used in gateway or gateway-tools an missed on vbcc are rebuild and
  26. all that functions includes in this library. Only the functions that
  27. use directly DOS-functions are in an external link-library (like unlink).
  28.  
  29.  
  30. The library.functions:
  31. __________________________________________________________________________
  32.  
  33. ULONG GateRequest(UBYTE *title_d1,UBYTE *body,UBYTE *gadgets);
  34.  
  35. Testfunction, work the library? Link to EasyRequest.
  36.  
  37. in:
  38. ---
  39. UBYTE *title_d1  - headline requester
  40. UBYTE *body      - body of requester
  41. UBYTE *gadgets   - text for gadgets
  42.  
  43.  
  44. back:
  45. -----
  46. ULONG            - the gadgetnumber
  47.  
  48. __________________________________________________________________________
  49.  
  50. char *ltofa(char *tx_d1,ULONG l);
  51.  
  52. (Long TO formatted ascii)
  53.  
  54. Function to format a ULONG like this:
  55.  
  56. 1234567890 => '1.234.567.890'
  57. 482        => '          482'
  58. 48526      => '       48.526'
  59.  
  60.  
  61. in:
  62. ---
  63. char  *tx_d1      - pointer to string (min. 14 chars)
  64. ULONG  l          - the ulong to format
  65.  
  66.  
  67. back:
  68. -----
  69. char  *           - pointer to tx_d1
  70.  
  71. __________________________________________________________________________
  72.  
  73. void trim(UBYTE *trptr);
  74.  
  75. strip all blank's left and right on the string.
  76.  
  77. in:
  78. ---
  79. UBYTE  *trtpr     - string to be cleared
  80.  
  81.  
  82. back:
  83. -----
  84. N/A
  85.  
  86. __________________________________________________________________________
  87.  
  88. void rtrim(UBYTE *trptr);" @{uu}@{LINDENT 6}
  89.  
  90. same as trim, but clear only the right side of the string.
  91.  
  92. in:
  93. ---
  94. UBYTE  *trtpr     - Pointer auf den String der bereinigt wird. Nach dem Funktionsaufruf ist der String bereinigt.
  95.  
  96.  
  97. back:
  98. -----
  99. N/A
  100.  
  101. __________________________________________________________________________
  102.  
  103. void lset(UBYTE *lbuff, int slen);
  104.  
  105. format a string to slen-chars.
  106. if the string is smaller: fill at left side with spaces.
  107. if the string is greater: cut right side
  108.  
  109. in:
  110. ---
  111. UBYTE  *lbuff    - pointer to string
  112. int     slen     - len the string have on return
  113.  
  114.  
  115. back:
  116. -----
  117. N/A
  118.  
  119. __________________________________________________________________________
  120.  
  121. void lsetmin(UBYTE *lbuff, int slen);
  122.  
  123. same as lset, but fill only the string, don't cut!
  124.  
  125. in:
  126. ---
  127. UBYTE  *lbuff    - pointer to string
  128. int     slen     - minimal len of string
  129.  
  130.  
  131. back:
  132. -----
  133. N/A
  134.  
  135. __________________________________________________________________________
  136.  
  137. void string(UBYTE *spstr, int num, int ch);
  138.  
  139. fill string *spstr with character ch at a len of num bytes.
  140.  
  141. in:
  142. ---
  143. UBYTE  *spstr    - pointer of string to be filled
  144. int     num      - len of string to be filled
  145. int     ch       - the character that will be used to fill
  146.  
  147.  
  148. back:
  149. -----
  150. N/A
  151.  
  152. __________________________________________________________________________
  153.  
  154. int instr(UBYTE *sa, UBYTE *sb);
  155.  
  156. search sb in sa and give back the position where sb found in sa.
  157. The position is 0 upto strlen(sa)-strlen(sb).
  158. -1 if not found.
  159. The case of the chars is not relevant (both strings will test uppercase or
  160. lowercase). The function do that for german chars, also ä, ö and ü will
  161. same as Ä, Ö and Ü.
  162.  
  163. in:
  164. ---
  165. UBYTE  *sa       - big string to search on
  166. UBYTE  *sb       - the searched string
  167.  
  168.  
  169. back:
  170. -----
  171. int              - positionwhre sb found or -1 if not
  172.  
  173. __________________________________________________________________________
  174.  
  175. void upstr(UBYTE *trptr);
  176.  
  177. make string uppercase including ä -> Ä, ö -> Ö and ü -> Ü
  178.  
  179. in:
  180. ---
  181. UBYTE  *trptr   - pointer to string
  182.  
  183.  
  184. back:
  185. -----
  186. N/A
  187.  
  188. __________________________________________________________________________
  189.  
  190. void lowstr(UBYTE *trptr);
  191.  
  192. make string lowercase including Ä -> ä, Ö -> ö and Ü -> ü
  193.  
  194. in:
  195. ---
  196. UBYTE  *trptr   - pointer to string
  197.  
  198. back:
  199. -----
  200. N/A
  201.  
  202. __________________________________________________________________________
  203.  
  204. void set(UBYTE *lbuff, int slen);
  205.  
  206. string will be return with len = slen.
  207. if the string is longer than slen, it will be cut
  208. if the string is to short blanks will be add at the end of string
  209.  
  210.  
  211. in:
  212. ---
  213. UBYTE  *lbuff   - pointer to string
  214. int     slen    - len for the string when returns
  215.  
  216.  
  217. back:
  218. -----
  219. N/A
  220.  
  221. __________________________________________________________________________
  222.  
  223. void midstr(UBYTE *mstr, int pos, long laenge);
  224.  
  225. cut a part (substring) from the string.
  226. pos is the beginning position ( 0-(strlen-1) ) and laenge means how many
  227. bytes will be cut. laenge=-1 means, from pos to end of string.
  228.  
  229.  
  230. in:
  231. ---
  232. UBYTE  *mstr    - pointer of string
  233. int     pos     - begin of substring
  234. int     laenge  - len for the substring or -1
  235.  
  236.  
  237. back:
  238. -----
  239. N/A
  240. __________________________________________________________________________
  241.  
  242. ULONG date_to_day(ULONG date);
  243.  
  244. Give the day in the year (1-365) for 'date'.
  245. This function isn't exact, it will only +/- 2 day's near the right,
  246. because it is only used for a cruncherfunction in the bbs-system that
  247. killed to old things.
  248.  
  249.  
  250.  
  251. in:
  252. ---
  253. ULONG date      - Date as ULONG in format ttmmjjjj
  254.  
  255.  
  256. back:
  257. -----
  258. ULONG           - day in year (1-365 +/-2 days)
  259.  
  260. __________________________________________________________________________
  261.  
  262. ULONG date_to_zahl(UBYTE *da);
  263.  
  264. Date from string to ULONG.
  265. Stringformat = TT.MM.JJJJ
  266. ULONG        = TTMMJJJJ
  267.  
  268.  
  269. in:
  270. ---
  271. UBYTE *da       - Date in format tt.mm.jjjj (the points can be any char)
  272.                   example: tt-mm-jjjj is also correct
  273.  
  274.  
  275. back:
  276. -----
  277. ULONG           - Date as ULONG=ttmmjjjj
  278.  
  279. __________________________________________________________________________
  280.  
  281. ULONG time_to_zahl(UBYTE *ti);
  282.  
  283. Time from string to ULONG
  284. A time in form SS:mm:ss will be returned as ULONG.
  285. The returned time can betwen 1 and 6 digits
  286. 00:00:07 = one, 10:10:05 = six
  287.  
  288.  
  289. in:
  290. ---
  291. UBYTE  *ti      - Time in SS:mm:ss (: can by any char)
  292.                   example: SS/mm/ss is also correct
  293.  
  294.  
  295. back:
  296. -----
  297. ULONG           - time as ULONG=SSmmss
  298.  
  299. __________________________________________________________________________
  300.  
  301. void kill_ansi(UBYTE *buffer);
  302.  
  303. delete most ansi-sequences from a string. Because this finction only need
  304. to delete cursor-functions and colors it search a character as end for a
  305. ansi-sequence. ansi-codes that end with special-characters are cut to
  306. many chars.
  307.  
  308.  
  309. in:
  310. ---
  311. UBYTE  *buffer  - pointer of string
  312.  
  313.  
  314. back:
  315. -----
  316. N/A
  317.  
  318. @ENDNODE
  319.  
  320. @NODE "newer" "newer"
  321. @{LINDENT 3}
  322. BOOL newer(UBYTE *d1, UBYTE *t1, UBYTE *d2, UBYTE *t2);
  323.  
  324. Is date d1 and time t1 NEWER than date d2 and time t2
  325.  
  326.  
  327. in:
  328. ---
  329. UBYTE  *d1     - 1. date in format tt.mm.jjjj
  330. UBYTE  *t1     - 1. time in format SS:mm:ss
  331. UBYTE  *d2     - 2. date in format tt.mm.jjjj
  332. UBYTE  *t2     - 2. time in format SS:mm:ss
  333.  
  334.  
  335. back:
  336. -----
  337. BOOL           - TRUE if the first set is newer as the second
  338.  
  339. __________________________________________________________________________
  340.  
  341. void swapmem(char *src, char *dst, int n);
  342.  
  343. swap a memoryblock of n bytes.
  344.  
  345.  
  346. in:
  347. ---
  348. char   *src    - pointer to first memoryblock.
  349. char   *dst    - pointer to second memoryblock.
  350. int     n      - how many bytes to be swapped
  351.  
  352.  
  353. back:
  354. -----
  355. N/A
  356.  
  357. __________________________________________________________________________
  358.  
  359. int memncmp(char *a, char *b, int length);
  360.  
  361. Compare to memoryblock's of n bytes
  362.  
  363.  
  364. in:
  365. ---
  366. char   *a      - pointer auf 1. memoryblock
  367. char   *b      - pointer auf 2. momoryblock
  368. int     lenght - how many bytes to be compare
  369.  
  370.  
  371. back:
  372. -----
  373. int            -  0 if equal
  374.                   1 if a > b
  375.                  -1 if a < b
  376.  
  377. __________________________________________________________________________
  378.  
  379. int StrCaseCmp(char *s1, char *s2);
  380.  
  381. Compare two strings (both as lower or upper). But german characters NOT
  382. convert, also ä not equal Ä.
  383.  
  384.  
  385. in:
  386. ---
  387. char   *s1     - pointer of 1. string
  388. char   *s2     - pointer of 2. String.
  389.  
  390.  
  391. back:
  392. -----
  393. int            -  0 if equal
  394.                   1 if not equal
  395. __________________________________________________________________________
  396.  
  397. void trim_includes(UBYTE *trptr);
  398.  
  399. see trim.
  400. this is a special-version that delete all what not be a part of a filename
  401. at begin and end of the string.
  402. pmm use this to isolate the includepath- and filename
  403.  
  404.  
  405. in:
  406. ---
  407. UBYTE  *trtpr     - pointer of string
  408.  
  409.  
  410. back:
  411. -----
  412. N/A
  413.  
  414. __________________________________________________________________________
  415.  
  416. void trim_includes(UBYTE *trptr, int fkt);
  417.  
  418. see trim.
  419. this specail-version delete all, what not be part of an emailadress
  420.  
  421.  
  422. in:
  423. ---
  424. UBYTE  *trtpr     - pointer of string
  425. int     fkt       - 1, if < and > will deleted
  426.                     0, if < and > not deleted
  427.  
  428. back:
  429. ----
  430. N/A
  431.  
  432. __________________________________________________________________________
  433.  
  434. void newstr(UBYTE *istr, UBYE *nstr, int pos, int len);
  435.  
  436.  
  437. that is the point who my english will be a problem. anyway:
  438. a part of istr will be cut. the same place will be filled with nstr.
  439. the len of nstr can be smaller, equal or greater than the part that
  440. will cut.
  441. the part to cut begin at 'pos' and has 'len' bytes.
  442.  
  443. The name istr come from the function that first use this function.
  444. It was the interpreter in the bbs-software.
  445.  
  446.  
  447.  
  448.  
  449. in:
  450. ---
  451. UBYTE  *istr      - pointer of string that will be changed
  452. UBYTE  *nstr      - pointer of new substring ("" will only cut)
  453. int     pos       - position to begin change
  454. int        len       - how many bytes changed (0 will only insert nstr)
  455.  
  456.  
  457.  
  458. back:
  459. -----
  460. N/A
  461.  
  462. __________________________________________________________________________
  463.  
  464. int wordwrp(UBYTE *line, UBYTE *rest, int len);
  465.  
  466. edit-sub-function
  467.  
  468. if line len or more bytes the function look for a blank in line[len] to
  469. line[len-20]. If a blank found, line will be cut at the blank an the
  470. right part is put to rest. If line shorter than len or not blank is
  471. found nothing happend with line and rest is return as char zero.
  472.  
  473.  
  474. in:
  475. ---
  476. UBYTE  *line      - string to check
  477. UBYTE  *rest      - if line cut the cutted-part is returned here. Else a
  478.                     char zero.
  479. int        len       - maximum len of line
  480.  
  481.  
  482. back:
  483. -----
  484. int                  - 0 = if nothing done
  485.                     1 = if cut and rest is filled
  486. __________________________________________________________________________
  487.  
  488. void fn_splitt(char *src, char *drive, char *path, char *name, char *ext);
  489.  
  490. Spliting the string src (a filename with full path) in the parts
  491. drive
  492. path
  493. filename (without extension)
  494. extension of filename
  495. All parts that not exits will be returned als char zero.
  496.  
  497.  
  498.  
  499. in:
  500. ---
  501. char   *src       - pointer of source-string
  502. char   *drive     - back drive
  503. char   *path      - back path
  504. char   *name      - back filename
  505. char   *ext       - back extension of filename
  506.  
  507.  
  508. back:
  509. -----
  510. char   *          - pointer to src
  511.  
  512. __________________________________________________________________________
  513.  
  514. void fn_build(char *dst, char *drive, char *path, char *name, char *ext);
  515.  
  516. cat all part's to a filename with full path.
  517.  
  518. drive must be end with :
  519. path can be end with or wthout /, if not, it will inserted
  520. name
  521. extension (beginning with a point, if not, it will be inserted.
  522.  
  523. If any part is empty, it will skip. If path empty no / inserted and if
  524. extension empty no point inserted.
  525.  
  526.  
  527. in:
  528. ---
  529. char   *dst       - the completed filename
  530. char   *drive     - drive:
  531. char   *path      - path[/]
  532. char   *name      - filename
  533. char   *ext       - [.]extension
  534.  
  535.  
  536. back:
  537. -----
  538. char   *          - pointer to dst
  539.  
  540. __________________________________________________________________________
  541.  
  542. void addval(UBYTE *str, ULONG n);
  543.  
  544. add the ULONG n to str (formatted 10 digits, left side filled with blank
  545.  
  546.  
  547. in:
  548. ---
  549. char   *addval    - string (10 bytes), numeric chars
  550.                     formatstring is %10lu
  551. ULONG   n         - value that add to the value in the string.
  552.  
  553.  
  554. back:
  555. -----
  556. N/A
  557.  
  558. __________________________________________________________________________
  559.  
  560. char *strdup(char *s);
  561.  
  562. return a duplicate of string s
  563.  
  564.  
  565. in:
  566. ---
  567. char   *s         - pointer to string
  568.  
  569.  
  570. Rückgabe:
  571. ---------
  572. char   *          - pointer of the copy from s
  573.  
  574. __________________________________________________________________________
  575.  
  576. char *index(const char *str, int c);
  577.  
  578. search the first char that is identical to char c
  579.  
  580.  
  581. in:
  582. ---
  583. const char *s     - pointer of searchable string
  584. int            c     - ascii-vaalue of char that will be searched
  585.  
  586. back:
  587. -----
  588. char   *          - pointer to position of c, if not found 0 returned
  589.  
  590.